package com.baiqian.doupo.event;

import com.baiqian.doupo.Utils;
import com.baiqian.doupo.world.ModFeatures;
import net.minecraft.world.biome.Biome;
import net.minecraft.world.gen.GenerationStage;
import net.minecraftforge.common.world.BiomeGenerationSettingsBuilder;
import net.minecraftforge.event.world.BiomeLoadingEvent;
import net.minecraftforge.eventbus.api.EventPriority;
import net.minecraftforge.eventbus.api.SubscribeEvent;
import net.minecraftforge.fml.common.Mod;

@Mod.EventBusSubscriber(modid = Utils.MOD_ID)
public class WorldEvent {
    @SubscribeEvent(priority = EventPriority.HIGH)
    public static void OreGenerator(BiomeLoadingEvent event) {
        BiomeGenerationSettingsBuilder builder = event.getGeneration();
        Biome.Category biome = event.getCategory();
        if (biome == Biome.Category.THEEND) {
            //暂时没有需要生成的内容，但以后可能会有，
        } else if (biome == Biome.Category.NETHER) {
            //暂时没有需要生成的内容，但以后可能会有，
        } else {
            builder.withFeature(GenerationStage.Decoration.VEGETAL_DECORATION, ModFeatures.Zi_Ye_Lan_Cao);
            builder.withFeature(GenerationStage.Decoration.VEGETAL_DECORATION, ModFeatures.Xi_Gu_Hua);
        }
    }
}
